<script setup lang="ts">
/**
1,导航栏.
*/
import router from "@/router";

const props = defineProps({title:String})

function onBack() {
    router.back();
}

</script>

<template>
<div class="bar">
    <button class="leftBtn" @click="onBack">返回</button>
    <span>{{ props.title ?? "" }}</span>
    <button class="rightBtn" @click="console.log(1)">xxx</button>
</div>
</template>



<style scoped>
.bar {
    height: 64px;
    background-color: yellow;
    display: flex;
    align-items: center;
    justify-content:space-between
}
.leftBtn {
    width:100px;
    background-color: red;
}
</style>